import axios from "axios";

const quickPost = async (url: string, formData: FormData | null = null)=>{
    try{
        const response = await axios.post(url, formData);
        return response.data;
    }catch (e){
        return {
            data: {
                success: false,
                message: e+""
            }
        }
    }
}

export function isNullOrWhiteSpace(str: unknown) {
    if (str === null || str === undefined){
        return true;
    }
    if (typeof str === 'string'){
        return str.trim() === '';
    }
    return false;
}

export {
    quickPost
}
